<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ page import="java.util.ArrayList" %>

<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Fermata"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>
    <script language="javascript" src="./script/popup_full_center.js"></script>
    <script language="javascript" src="./script/confirmCM.js"></script>    

    <br />
    <table class="find" style="border: 2pt solid white; margin-bottom: -10px">
        <hr />
        <tr>  
            <td class="intestazionePagina" align="center">
                <strong>GESTIONE FERMATE</strong></td>                        
        </tr>        
    </table>

    <t:saveState value="#{beanFermata}"/>
    <h:form binding="#{dettaglioFermata.form}" id="formLookup">    
        <table class="dettaglio">  
            <tbody>          
                <tr>                   
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="codice" value="Codice Fermata (*)"/></strong></td>
                    <td><t:inputText id="codice" value="#{beanFermata.codice}" size="10" maxlength="8" styleClass="dettaglio_InputText" immediate="true" disabled="false"/></td>
                </tr>              

                <tr>
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="descrizioneComune" value="Comune" /></strong></td>
                    <td>
                        <h:selectOneMenu id="comune" value="#{beanFermata.idComune}"  style=" width:90%;">
                            <f:selectItems value="#{beanFermata.listaComuni}" />
                        </h:selectOneMenu> 
                    </td>              

                </tr>   


                <tr>                   
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="indirizzo" value="Indirizzo"/></strong></td>
                    <td><t:inputText id="indirizzo" value="#{beanFermata.indirizzo}"  size="75" maxlength="50"  styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()"/>
                        <h:message style="color: red" for="indirizzo" showDetail="true" showSummary="false" /></td>
                </tr>   



                <tr>                   
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="note" value="Note"/></strong></td>
                    <td><t:inputText id="note" value="#{beanFermata.note}"  size="100" maxlength="256"  styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()"/>
                        <h:message style="color: red" for="note" showDetail="true" showSummary="false" /></td>
                </tr> 

        </table>
        <br/>

        <t:inputHidden value="#{beanFermata.id}"/>
        <table bgcolor="#FFFFFF" width="750px">
            <tr>     
                <td>
                    <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                        <t:graphicImage url="/image/go-home.png" border="0"/>
                    </h:commandLink>              
                </td>   
                <td>
                    <t:commandLink action="#{dettaglioFermata.primo}"  rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/primo.png" border="0" title="Vai al primo elemento"/>
                        <f:param name="bean" value="beanFermata"/>                        
                        <f:param name="id" value="#{beanFermata.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioFermata.precedente}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/indietro.png" border="0" title="Indietro"/>
                        <f:param name="bean" value="beanFermata"/>                        
                        <f:param name="id" value="#{beanFermata.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioFermata.successivo}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/avanti.png" border="0" title="Avanti"/>
                        <f:param name="bean" value="beanFermata"/>                        
                        <f:param name="id" value="#{beanFermata.id}"/>                 
                    </t:commandLink>
                </td>
                <td>
                    <t:commandLink action="#{dettaglioFermata.ultimo}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/ultimo.png" border="0" title="Vai all'ultimo elemento"/>
                        <f:param name="bean" value="beanFermata"/>                        
                        <f:param name="id" value="#{beanFermata.id}"/>                 
                    </t:commandLink>
                </td>

                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmDelete(this);" title="cancella" action="#{dettaglioFermata.cancella}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/stop.png" border="0" title="Cancella"/>
                        <f:param name="bean" value="beanFermata" />
                    </h:commandLink>                
                </td>                               
                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmUpdate(this);" title="modifica" action="#{dettaglioFermata.modifica}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/salva.png" border="0" title="Salva modifiche"/>
                        <f:param name="bean" value="beanFermata" />
                    </h:commandLink>                
                </td>    

                <td>
                    <h:commandLink dir="RTL" onmousedown="return confirmSave(this);" title="salva inserimento" action="#{dettaglioFermata.inserisci}" rendered="#{beanFermata.id eq null}">
                        <t:graphicImage url="image/salva.png" border="0" title="Salva inserimento"/>
                        <f:param name="bean" value="beanFermata" />
                    </h:commandLink>                
                </td>
                <%--
                <td>
                <h:commandLink dir="RTL" title="Annulla operazione" action="#{dettaglioFermata.annulla}" rendered="#{beanFermata.id eq null}" immediate="true">
                <t:graphicImage url="image/delete.png" border="0"/>
                <f:param name="bean" value="beanFermata" />
                </h:commandLink>                     
                </td>
                --%>
                <td>
                    <h:commandLink dir="RTL" title="inserisce nuovo elemento" action="#{dettaglioFermata.inserisciDettaglio}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/nuovo.png" border="0" title="Inserisci NUOVO"/>
                        <f:param name="bean" value="beanFermata" />
                    </h:commandLink>
                </td>

                <td>
                    <h:commandLink  title="LISTA" id="lista" action="#{dettaglioFermata.lista}" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/lista.png" border="0" title="Carica lista" style="width:32px; height:32px"/>
                        <f:param name="bean" value="Fermata" />
                    </h:commandLink>
                </td> 

                <td>                
                    <t:commandLink id="cerca1" onclick="loadurl('pages_ricerca/ricercaFermate.jsf');" immediate="true" rendered="#{beanFermata.id ne null}">
                        <t:graphicImage url="image/find.png" border="0" title="Cerca Elemento" style="width:32px; height:32px"/>
                    </t:commandLink>
                </td>   

                <td>                
                    <t:commandLink id="aiuto" onclick="loadurl('info/legendaBottoniDettaglio.jsf');" immediate="true">
                        <t:graphicImage url="image/help.png" border="0" title="Aiuto"/>
                    </t:commandLink>
                </td> 
            </tr>
        </table>
    </h:form> 

    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
                <h:messages style="color: red" showDetail="true" showSummary="false"/>
                <f:verbatim></td></table></f:verbatim>
            </h:form>     

    <jsp:include page="/piePagina.jsp"/>      
</f:view>